﻿@using BlueLotus7.SSQAnalysisCore;
@model AnalysisResult
@{
    if (Model == null)
    {
        return;
    }

}
<div class="report-paper">
    <div class="report-section">
        <div class="report-section-header"></div>
        <div class="report-section-body"></div>
        <fieldset>
            <legend>基本信息统计</legend>
            <div>
                <table class="ball-table">
                    <thead>
                        <tr>
                            <th class="title"></th>
                            @{
                                for (int i = 1; i <= Constant.RedBallQuantity; i++)
                                {
                                <text>
                                <th class="red">
                                    @(i.ToString("00"))
                                </th>
                                </text>
                                }
                                for (int i = 1; i <= Constant.BlueBallQuantity; i++)
                                {
                                <text>
                                <th class="blue">
                                    @(i.ToString("00"))
                                </th>
                                </text>
                                }
                            }
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td class="title">命中数 </td>
                            @{
                                /// Red balls
                                for (int i = 1; i <= Constant.RedBallQuantity; i++)
                                {
                                    var value = Model.HitCount.RedBalls[i];
                                <text>
                                <td class="red">
                                    @(((int)value).ToString())
                                </td>
                                </text>
                                }
                                /// Blue balls
                                for (int i = 1; i <= Constant.BlueBallQuantity; i++)
                                {
                                    var value = Model.HitCount.BlueBalls[i];
                                <text>
                                <td class="blue">
                                    @(((int)Model.HitCount.RedBalls[i]).ToString())
                                </td>
                                </text>
                                }
                            }
                        </tr>
                        <tr>
                            <td class="title">命中率 </td>
                            @{
                                /// Red balls
                                for (int i = 1; i <= Constant.RedBallQuantity; i++)
                                {
                                    var value = Analyzer.Divide(Model.HitCount.RedBalls[i], Model.TotalStageCount).Percentaging("0.0%");
                                <text>
                                <td class="red">
                                    @(value)
                                </td>
                                </text>
                                }
                                /// Blue balls
                                for (int i = 1; i <= Constant.BlueBallQuantity; i++)
                                {
                                    var value = Analyzer.Divide(Model.HitCount.BlueBalls[i], Model.TotalStageCount).Percentaging("0.0%");
                                <text>
                                <td class="blue">
                                    @(value)
                                </td>
                                </text>
                                }
                            }
                        </tr>
                        <tr>
                            <td class="title">基本综合概率 </td>
                            @{
                                /// Red balls
                                for (int i = 1; i <= Constant.RedBallQuantity; i++)
                                {
                                    var value = Model.BasePercentage.RedBalls[i];
                                <text>
                                <td class="red">
                                    @(value.ToString("0.000"))
                                </td>
                                </text>
                                }
                                /// Blue balls
                                for (int i = 1; i <= Constant.BlueBallQuantity; i++)
                                {
                                    var value = Model.BasePercentage.BlueBalls[i];
                                <text>
                                <td class="blue">
                                    @(value.ToString("0.000"))
                                </td>
                                </text>
                                }
                            }
                        </tr>
                    </tbody>
                </table>
            </div>
        </fieldset>
    </div>
    <div class="report-section">
        <div class="report-section-header"></div>
        <div class="report-section-body"></div>
        <fieldset>
            <legend>依赖性阵列</legend>
            <div>
                <table class="ball-table">
                    <thead>
                        <tr>
                            <th class="title"></th>
                            @{
                                for (int i = 1; i <= Constant.RedBallQuantity; i++)
                                {
                                <text>
                                <th class="red">
                                    @(i.ToString("00"))
                                </th>
                                </text>
                                }                             
                            }
                        </tr>
                    </thead>
                    <tbody>
                        @{
                            for (int rowIndex = 1; rowIndex <= Constant.RedBallQuantity; rowIndex++)
                            {
                                var currentRow = Model.PRMartix.GetRow(rowIndex);
                            <text>
                            <tr>
                                <td class="title">
                                    @(rowIndex.ToString("00"))
                                </td>
                                @{
                                /// Red balls
                                for (int i = 1; i <= Constant.RedBallQuantity; i++)
                                {
                                    var value = currentRow[i];
                                    <text>
                                    <td class="red">
                                        @(value.ToString("0.000"))
                                    </td>
                                    </text>
                                }
                                }
                            </tr>
                            </text>
                            }
                        }
                    </tbody>
                </table>
            </div>
        </fieldset>
    </div>
    <div class="report-section">
        <div class="report-section-header"></div>
        <div class="report-section-body"></div>
        <fieldset>
            <legend>分析结果</legend>
        </fieldset>
    </div>
</div>
